﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
										xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
										xmlns:local="clr-namespace:Stema.Controls"
										xmlns:localConverters="clr-namespace:Stema.Controls.Converters"
										xmlns:localWindows="clr-namespace:Stema.Windows"
										xmlns:sys="clr-namespace:System;assembly=mscorlib" 
										xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
										xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
										mc:Ignorable="d">
	<ResourceDictionary.MergedDictionaries>
		<ResourceDictionary Source="/NavigationPane;component/Themes/Common.xaml"/>
		<!-- include common text, images and commands text -->
		<ResourceDictionary Source="/NavigationPane;component/Themes/NavigationPane/NavigationPaneCommon.xaml"/>
		<!-- as default use Office 2010 Silver Theme colors - - >
		<ResourceDictionary Source="/NavigationPane;component/Themes/NavigationPane/Office2010/Silver.xaml"/>
		-->
		<ResourceDictionary Source="/NavigationPane;component/Resources/Buttons.xaml"/>
	</ResourceDictionary.MergedDictionaries>

	<localConverters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
	<localConverters:BooleanNegateConverter x:Key="BooleanNegateConverter"/>

	<Style x:Key="NavigationPaneToggleButton" TargetType="{x:Type ToggleButton}">
		<Setter Property="Background" Value="Transparent" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
					<Border x:Name="border" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
						<ContentPresenter/>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter
						Property="Cursor" Value="Hand"/>
							<Setter
						Property="Background" TargetName="border" Value="{DynamicResource {ComponentResourceKey ResourceId=ButtonBackgroundOver, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
						</Trigger>
						<Trigger Property="IsPressed" Value="True">
							<Setter Property="Background" TargetName="border" Value="{DynamicResource {ComponentResourceKey ResourceId=ButtonBackgroundSelected, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Setter Property="BorderThickness" Value="0"/>
	</Style>


	<Style TargetType="{x:Type local:NavigationPaneItem}">
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type local:NavigationPaneItem}">
					<DockPanel>
						<local:NavigationPaneButton x:Name="PART_ItemButton" DockPanel.Dock="Top" Image="{TemplateBinding Image}" ImageSmall="{TemplateBinding ImageSmall}" 
																				IsChecked="{Binding IsSelected, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ImageType="Large" Margin="{DynamicResource {ComponentResourceKey ResourceId=LargeItemsMargin, TypeInTargetAssembly={x:Type local:NavigationPane}}}"
																				IsContentVisible="{Binding Path=IsMinimized, RelativeSource={RelativeSource FindAncestor, AncestorType=local:NavigationPane}, Converter={StaticResource BooleanNegateConverter}}" Anchor="Top"
																				Content="{TemplateBinding Header}" FontWeight="Bold" Foreground="{DynamicResource {ComponentResourceKey ResourceId=ForeColorInactive, TypeInTargetAssembly={x:Type local:NavigationPane}}}" CheckMode="Check" Padding="{DynamicResource {ComponentResourceKey ResourceId=LargeItemsPadding, TypeInTargetAssembly={x:Type local:NavigationPane}}}" ContentTemplate="{TemplateBinding HeaderTemplate}" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" ContentStringFormat="{TemplateBinding HeaderStringFormat}" 
																				ToolTip="{TemplateBinding ButtonToolTipGesture}"/>
						<ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" DockPanel.Dock="Top" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" />
					</DockPanel>
					<ControlTemplate.Triggers>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition  SourceName="PART_ItemButton" Property="IsMouseOver" Value="True"/>
								<Condition Property="IsSelected" Value="True"/>
							</MultiTrigger.Conditions>
							<Setter Property="Foreground" TargetName="PART_ItemButton" Value="{DynamicResource {ComponentResourceKey ResourceId=ForeColorOver, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
						</MultiTrigger>
						<Trigger Property="IsMouseOver" Value="True" SourceName="PART_ItemButton">
							<Setter Property="Foreground" TargetName="PART_ItemButton" Value="{DynamicResource {ComponentResourceKey ResourceId=ForeColorOver, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
						</Trigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="Selector.IsSelected" Value="True"/>
								<Condition Property="IsMouseOver" Value="False" SourceName="PART_ItemButton"/>
							</MultiTrigger.Conditions>
							<Setter
						Property="Foreground" TargetName="PART_ItemButton" Value="{DynamicResource {ComponentResourceKey ResourceId=ForeColorActive, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
						</MultiTrigger>
						<Trigger Property="IsInsideNavigationPane" Value="True">
							<Setter Property="Visibility" TargetName="contentPresenter" Value="Collapsed"/>
						</Trigger>
						<Trigger Property="local:NavigationPanePanel.ItemDisplayType" Value="Small">
							<Setter Property="IsContentVisible" TargetName="PART_ItemButton" Value="False"/>
							<Setter Property="Margin" TargetName="PART_ItemButton" Value="-1,0,0,0"/>
							<Setter Property="DockPanel.Dock" TargetName="PART_ItemButton" Value="Right"/>
							<Setter Property="ImageType" TargetName="PART_ItemButton" Value="Small"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style x:Key="ExpanderItemStyle" TargetType="{x:Type local:NavigationPaneItem}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type local:NavigationPaneItem}">
					<StackPanel Margin="2">
						<Grid Margin="4,0">
							<ContentPresenter />
						</Grid>
						<local:NavigationPaneSplitter x:Name="navigationPaneSplitter" VerticalAlignment="Top" Margin="0,1,0,0" />
					</StackPanel>
					<ControlTemplate.Triggers>
						<Trigger Property="local:NavigationPaneExpander.CanResize" Value="False">
							<Setter Property="Visibility" TargetName="navigationPaneSplitter" Value="Collapsed"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<Style x:Key="NavigationItemStyle" TargetType="{x:Type local:NavigationPaneItem}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type local:NavigationPaneItem}">
					<ContentPresenter/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
		
	<DataTemplate x:Key="ExpanderHeaderTemplate">
		<TextBlock FontWeight="Bold" FontSize="13.333" Margin="0,2,0,2">
			<ContentPresenter Content="{Binding}"/>
		</TextBlock>
	</DataTemplate>

	<Style x:Key="ExpanderPopupResizePreviewStyle">
		<Setter Property="Control.Template">
			<Setter.Value>
				<ControlTemplate>
					<Rectangle Stroke="#FF1F1F1F" Cursor="SizeWE"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<DataTemplate x:Key="ExpanderItemsHeader" DataType="{x:Type local:NavigationPaneExpanderItemsHeader}">
		<StackPanel Orientation="Horizontal" Margin="0,0,16,0">
			<Image x:Name="image" Source="{Binding Image}" Stretch="Uniform" Width="16" Height="16" SnapsToDevicePixels="True" Margin="0,2,4,2" RenderTransformOrigin="0.5,0.5" >
				<Image.RenderTransform>
					<TransformGroup>
						<RotateTransform Angle="-90"/>
					</TransformGroup>
				</Image.RenderTransform>
			</Image>
			<ContentControl Content="{Binding Content}" SnapsToDevicePixels="True" VerticalAlignment="Center"/>
		</StackPanel>
		<DataTemplate.Triggers>
			<DataTrigger Binding="{Binding Image}" Value="{x:Null}">
				<Setter TargetName="image" Property="Visibility" Value="Collapsed" />
			</DataTrigger>
			<DataTrigger Binding="{Binding Path=Orientation, RelativeSource={RelativeSource FindAncestor, AncestorType=local:NavigationPaneExpander, AncestorLevel=1}}" Value="Left">
				<Setter TargetName="image" Property="RenderTransform">
					<Setter.Value>
						<TransformGroup>
							<RotateTransform Angle="90"/>
						</TransformGroup>
					</Setter.Value>
				</Setter>
			</DataTrigger>
		</DataTemplate.Triggers>
	</DataTemplate>
	
	<Style x:Key="ResizeThumb" TargetType="{x:Type Thumb}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Thumb}">
					<Grid Background="{TemplateBinding Background}"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="Width" Value="3"/>
		<Setter Property="Cursor" Value="{x:Static localWindows:Cursors.SizeWE}"/>
	</Style>
	
	<Style TargetType="{x:Type local:NavigationPaneExpander}">
		<Setter Property="PopupResizePreviewStyle" Value="{StaticResource ExpanderPopupResizePreviewStyle}"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type local:NavigationPaneExpander}">
						<DockPanel d:LayoutOverrides="Width">
							<Thumb x:Name="PART_ResizeThumb" Style="{StaticResource ResizeThumb}" Background="Transparent" />
							<Border x:Name="border2" Background="{TemplateBinding Background}"
								BorderBrush="{TemplateBinding BorderBrush}"
								BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True"
								DockPanel.Dock="Right">
								<Grid>
									<Grid.RowDefinitions>
										<RowDefinition Height="Auto"/>
										<RowDefinition Height="*"/>
									</Grid.RowDefinitions>
									<Popup x:Name="PART_Popup" PlacementTarget="{Binding ElementName=PART_MininizedSizeProvider}" PopupAnimation="Fade" AllowsTransparency="True" IsOpen="{Binding IsPopupOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" StaysOpen="True" Placement="Right" Grid.RowSpan="2" HorizontalOffset="-4" VerticalOffset="2" Margin="0,0,4,4" Height="{Binding ActualHeight, ElementName=PART_MininizedSizeProvider}" Width="{TemplateBinding Width}" >
										<Grid Margin="0,0,4,4">
											<Grid.Effect>
												<DropShadowEffect Opacity="0.3" ShadowDepth="3" BlurRadius="4"/>
											</Grid.Effect>
											<Border x:Name="border3" BorderBrush="{DynamicResource {ComponentResourceKey ResourceId=ButtonBorder, TypeInTargetAssembly={x:Type local:NavigationPane}}}" BorderThickness="1" Background="{DynamicResource {ComponentResourceKey ResourceId=ButtonBorderInnerSelected, TypeInTargetAssembly={x:Type local:NavigationPane}}}" >
												<Grid>
													<Border Padding="2" Background="{DynamicResource {ComponentResourceKey ResourceId=Background, TypeInTargetAssembly={x:Type local:NavigationPane}}}" x:Name="PART_ContentHostContainerUnexpanded" BorderBrush="{DynamicResource {ComponentResourceKey ResourceId=ButtonBorderInnerSelected, TypeInTargetAssembly={x:Type local:NavigationPane}}}" />
													<Rectangle x:Name="rectangle" Fill="{StaticResource SizeGrip}" Width="10" Height="10" StrokeThickness="0" HorizontalAlignment="Right" VerticalAlignment="Bottom" Visibility="Collapsed"/>
												</Grid>
											</Border>
										</Grid>
									</Popup>
									<local:NavigationPaneButton x:Name="PART_MininizedSizeProvider" IsChecked="{Binding IsPopupOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Grid.Row="1" Visibility="Hidden" FontWeight="Bold" Cursor="Hand" CheckMode="CheckUncheck" ToolTip="{TemplateBinding BarToolTip}" Margin="1" Anchor="Right" VerticalContentAlignment="Top" HorizontalContentAlignment="Center" Padding="0" HorizontalAlignment="Right">
										<DockPanel VerticalAlignment="Center">
											<Border x:Name="PART_HeaderHostMinimized" Margin="0,0,6,0"/>
											<ItemsControl x:Name="headers" ItemsSource="{TemplateBinding ItemsHeaders}" ItemTemplate="{TemplateBinding ItemsHeadersTemplate}">
												<ItemsControl.ItemsPanel>
													<ItemsPanelTemplate>
														<StackPanel IsItemsHost="True" Orientation="Horizontal"/>
													</ItemsPanelTemplate>
												</ItemsControl.ItemsPanel>
											</ItemsControl>
										</DockPanel>
									</local:NavigationPaneButton>
									<Border x:Name="PART_ContentHostContainerExpanded" Grid.Row="1">
										<ItemsPresenter x:Name="PART_ContentHost"/>
									</Border>
									<Border x:Name="border" Background="{DynamicResource {ComponentResourceKey ResourceId=TitleBackground, TypeInTargetAssembly={x:Type local:NavigationPane}}}" BorderBrush="{DynamicResource {ComponentResourceKey ResourceId=ButtonBorder, TypeInTargetAssembly={x:Type local:NavigationPane}}}" BorderThickness="{DynamicResource {ComponentResourceKey ResourceId=TitleBorder, TypeInTargetAssembly={x:Type local:NavigationPane}}}">
										<Border x:Name="border1" BorderBrush="{DynamicResource {ComponentResourceKey ResourceId=TitleInnerBrush, TypeInTargetAssembly={x:Type local:NavigationPane}}}" BorderThickness="{DynamicResource {ComponentResourceKey ResourceId=TitleInnerRight, TypeInTargetAssembly={x:Type local:NavigationPane}}}">
											<DockPanel x:Name="dockPanel">
												<StackPanel x:Name="buttons" Orientation="Horizontal" VerticalAlignment="Top" 
													Visibility="{TemplateBinding IsMinimizeButtonVisible, ConverterParameter=inverse, Converter={StaticResource BooleanToVisibilityConverter}}">
													<ToggleButton x:Name="ExpandBtn" IsChecked="{Binding IsMinimized, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" BorderThickness="0" Height="16" ToolTip="{TemplateBinding ButtonToolTip}" Style="{StaticResource NavigationPaneToggleButton}" Width="16" VerticalAlignment="Top" >
														<Rectangle x:Name="arrow" Fill="{DynamicResource {ComponentResourceKey ResourceId=ArrowRight, TypeInTargetAssembly={x:Type local:NavigationPane}}}" SnapsToDevicePixels="True" />
													</ToggleButton>
													<ToggleButton x:Name="PART_CloseButton" HorizontalAlignment="Right" Width="16" Height="16" Style="{StaticResource NavigationPaneToggleButton}" Margin="2,0,0,0" Visibility="Collapsed" Command="{TemplateBinding CloseCommand}" CommandParameter="{TemplateBinding CloseCommandParameter}" CommandTarget="{TemplateBinding CloseCommandTarget}">
														<Rectangle x:Name="close" Fill="{DynamicResource {ComponentResourceKey ResourceId=Close, TypeInTargetAssembly={x:Type local:NavigationPane}}}" SnapsToDevicePixels="True"/>
													</ToggleButton>
												</StackPanel>
												<Border x:Name="PART_HeaderHost" Margin="10,0,0,0">
													<ContentPresenter x:Name="contentPresenter" ContentSource="Header" Visibility="Collapsed" />
												</Border>
											</DockPanel>
										</Border>
									</Border>
								</Grid>
							</Border>
						</DockPanel>
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="True" SourceName="ExpandBtn">
							<Setter Property="Fill" TargetName="arrow" Value="{DynamicResource {ComponentResourceKey ResourceId=ArrowRightOver, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
						</Trigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMouseOver" SourceName="ExpandBtn" Value="True"/>
								<Condition Property="Orientation" Value="Right"/>
							</MultiTrigger.Conditions>
							<Setter Property="Fill" TargetName="arrow" Value="{DynamicResource {ComponentResourceKey ResourceId=ArrowLeftOver, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
						</MultiTrigger>
						<Trigger Property="HasResizeThumb" Value="False">
							<Setter Property="Visibility" TargetName="PART_ResizeThumb" Value="Collapsed"/>
						</Trigger>
						<Trigger Property="IsInsideNavigationPane" Value="True">
							<Setter Property="Margin" TargetName="PART_MininizedSizeProvider" Value="1,6,1,1"/>
							<Setter Property="Height" TargetName="PART_Popup" Value="Auto"/>
							<Setter Property="VerticalContentAlignment" TargetName="PART_MininizedSizeProvider" Value="Center"/>
							<Setter Property="BorderThickness" TargetName="border2" Value="0"/>
							<Setter Property="BorderThickness" TargetName="border3" Value="0,1,1,1"/>
							<Setter Property="Padding" TargetName="border3" Value="3,0,3,3"/>
							<Setter Property="BorderThickness" TargetName="PART_ContentHostContainerUnexpanded" Value="0,0,0,1"/>
							<Setter Property="Visibility" TargetName="rectangle" Value="Visible"/>
							<Setter Property="Margin" TargetName="rectangle" Value="0,0,0,1"/>
						</Trigger>
						<Trigger Property="IsHeaderVisible" Value="True">
							<Setter
								Property="Visibility" TargetName="contentPresenter" Value="Visible"/>
						</Trigger>
						<Trigger Property="Orientation" Value="Left">
							<Setter Property="Placement" TargetName="PART_Popup" Value="Left"/>
							<Setter Property="Fill" TargetName="arrow" Value="{DynamicResource {ComponentResourceKey ResourceId=ArrowRight, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
							<Setter Property="Anchor" TargetName="PART_MininizedSizeProvider" Value="Left"/>
							<Setter Property="DockPanel.Dock" TargetName="buttons" Value="Right"/>
							<Setter Property="BorderThickness" TargetName="border1" Value="{DynamicResource {ComponentResourceKey ResourceId=TitleInnerLeft, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
							<Setter Property="HorizontalOffset" TargetName="PART_Popup" Value="4"/>
							<Setter Property="DockPanel.Dock" TargetName="headers" Value="Left"/>
							<Setter Property="DockPanel.Dock" TargetName="PART_ResizeThumb" Value="Right"/>
						</Trigger>
						<Trigger Property="IsMinimized" Value="True">
							<Setter Property="Visibility" TargetName="PART_MininizedSizeProvider" Value="Visible"/>
							<Setter Property="Visibility" TargetName="PART_HeaderHost" Value="Collapsed"/>
							<Setter Property="HorizontalAlignment" TargetName="dockPanel" Value="Center"/>
						</Trigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMinimized" Value="False"/>
								<Condition Property="Orientation" Value="Left"/>
							</MultiTrigger.Conditions>
							<Setter Property="Fill" TargetName="arrow" Value="{DynamicResource {ComponentResourceKey ResourceId=ArrowLeft, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMinimized" Value="False"/>
								<Condition Property="Orientation" Value="Left"/>
								<Condition SourceName="ExpandBtn" Property="IsMouseOver" Value="True"/>
							</MultiTrigger.Conditions>
							<Setter Property="Fill" TargetName="arrow" Value="{DynamicResource {ComponentResourceKey ResourceId=ArrowLeftOver, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMinimized" Value="True"/>
								<Condition Property="Orientation" Value="Left"/>
								<Condition SourceName="ExpandBtn" Property="IsMouseOver" Value="True"/>
							</MultiTrigger.Conditions>
							<Setter Property="Fill" TargetName="arrow" Value="{DynamicResource {ComponentResourceKey ResourceId=ArrowRightOver, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMinimized" Value="True"/>
								<Condition Property="Orientation" Value="Right"/>
							</MultiTrigger.Conditions>
							<Setter Property="Fill" TargetName="arrow" Value="{DynamicResource {ComponentResourceKey ResourceId=ArrowLeft, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMinimized" Value="True"/>
								<Condition Property="Orientation" Value="Right"/>
								<Condition SourceName="ExpandBtn" Property="IsMouseOver" Value="True"/>
							</MultiTrigger.Conditions>
							<Setter Property="Fill" TargetName="arrow" Value="{DynamicResource {ComponentResourceKey ResourceId=ArrowLeftOver, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMinimized" Value="False"/>
								<Condition Property="Orientation" Value="Right"/>
								<Condition SourceName="ExpandBtn" Property="IsMouseOver" Value="True"/>
							</MultiTrigger.Conditions>
							<Setter Property="Fill" TargetName="arrow" Value="{DynamicResource {ComponentResourceKey ResourceId=ArrowRightOver, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsCloseButtonVisible" Value="True"/>
								<Condition Property="IsMinimized" Value="False"/>
							</MultiTrigger.Conditions>
							<Setter
								Property="Visibility" TargetName="PART_CloseButton" Value="Visible"/>
							<Setter
								Property="Margin" TargetName="PART_CloseButton" Value="6,0,0,0"/>
							<Setter Property="DockPanel.Dock" TargetName="buttons" Value="Right"/>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMinimized" Value="True"/>
								<Condition Property="IsInsideNavigationPane" Value="True"/>
							</MultiTrigger.Conditions>
							<Setter Property="HorizontalOffset" TargetName="PART_Popup" Value="0"/>
							<Setter Property="VerticalOffset" TargetName="PART_Popup" Value="0"/>
							<Setter Property="Visibility" TargetName="contentPresenter" Value="Visible"/>
						</MultiTrigger>
						<Trigger Property="IsMouseOver" Value="True" SourceName="PART_CloseButton">
							<Setter Property="Fill" TargetName="close" Value="{DynamicResource {ComponentResourceKey ResourceId=CloseOver, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=Background, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
		<Setter Property="Foreground" Value="{DynamicResource {ComponentResourceKey ResourceId=ForeColorActive, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
		<Setter Property="BorderThickness" Value="{DynamicResource {ComponentResourceKey ResourceId=BorderThickness, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
		<Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey ResourceId=ButtonBorder, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
		<Setter Property="IsHeaderVisible" Value="{DynamicResource {ComponentResourceKey ResourceId=IsHeaderVisible, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
		<Setter Property="IsCloseButtonVisible" Value="{DynamicResource {ComponentResourceKey ResourceId=IsCloseButtonVisible, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
		<Setter Property="HeaderTemplate" Value="{StaticResource ExpanderHeaderTemplate}"/>
		<Setter Property="ItemContainerStyle" Value="{StaticResource ExpanderItemStyle}"/>
		<Setter Property="ItemsHeadersTemplate" Value="{StaticResource ExpanderItemsHeader}"/>
	</Style>

	<Style TargetType="{x:Type local:NavigationPaneButton}">
		<Style.Triggers>
			<Trigger Property="IsMouseOver" Value="True">
				<Setter
		Property="Foreground" Value="{DynamicResource {ComponentResourceKey ResourceId=ForeColorOver, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
			</Trigger>
		</Style.Triggers>
		<Setter Property="BorderThickness" Value="{DynamicResource {ComponentResourceKey ResourceId=ButtonBorderThickness, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type local:NavigationPaneButton}">
					<Border x:Name="border" BorderThickness="{TemplateBinding BorderThickness}" Padding="{DynamicResource {ComponentResourceKey ResourceId=ButtonBorderInnerThickness, TypeInTargetAssembly={x:Type local:NavigationPane}}}" Background="{DynamicResource {ComponentResourceKey ResourceId=ButtonBackground, TypeInTargetAssembly={x:Type local:NavigationPane}}}" BorderBrush="{DynamicResource {ComponentResourceKey ResourceId=ButtonBorder, TypeInTargetAssembly={x:Type local:NavigationPane}}}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
						<Grid x:Name="grid">
							<Rectangle x:Name="shine" Fill="{DynamicResource {ComponentResourceKey ResourceId=ButtonShineBrush, TypeInTargetAssembly={x:Type local:NavigationPane}}}" Visibility="Hidden"/>
							<DockPanel x:Name="dockPanel" Margin="{TemplateBinding Padding}">
								<Image x:Name="image" Source="{TemplateBinding Image}" SnapsToDevicePixels="True" Stretch="UniformToFill" Visibility="Collapsed" Height="24" Width="24" Margin="0,0,2,0"/>
								<Image x:Name="imageSmall" Height="16" Source="{TemplateBinding ImageSmall}" SnapsToDevicePixels="True" Width="16" Stretch="UniformToFill" Visibility="Collapsed" Margin="0,0,2,0"/>
								<Grid x:Name="headerContent" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
									<ContentPresenter  x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" ContentStringFormat="{TemplateBinding ContentStringFormat}"/>
								</Grid>
							</DockPanel>
						</Grid>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="DisplayState" Value="Normal">
							<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {ComponentResourceKey ResourceId=ButtonBorderInactive, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
						</Trigger>
						<Trigger Property="DisplayState" Value="Pressed">
							<Setter Property="Background" TargetName="border" Value="{DynamicResource {ComponentResourceKey ResourceId=ButtonBorderInnerPressed, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
							<Setter Property="Background" TargetName="grid" Value="{DynamicResource {ComponentResourceKey ResourceId=ButtonBackgroundPressed, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
						</Trigger>
						<Trigger Property="DisplayState" Value="Checked">
							<Setter Property="Background" TargetName="border" Value="{DynamicResource {ComponentResourceKey ResourceId=ButtonBorderInnerSelected, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
							<Setter Property="Background" TargetName="grid" Value="{DynamicResource {ComponentResourceKey ResourceId=ButtonBackgroundSelected, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
							<Setter Property="Effect" TargetName="border" Value="{DynamicResource {ComponentResourceKey ResourceId=ButtonShadow, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
							<Setter Property="Visibility" TargetName="shine" Value="Visible"/>
						</Trigger>
						<Trigger Property="DisplayState" Value="Over">
							<Setter
								Property="Background" TargetName="border" Value="{DynamicResource {ComponentResourceKey ResourceId=ButtonBorderInnerOver, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
							<Setter
								Property="Background" TargetName="grid" Value="{DynamicResource {ComponentResourceKey ResourceId=ButtonBackgroundOver, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
							<Setter Property="Visibility" TargetName="shine" Value="Visible"/>
							<Setter Property="Effect" TargetName="border" Value="{DynamicResource {ComponentResourceKey ResourceId=ButtonShadow, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
						</Trigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="DisplayState" Value="Normal"/>
								<Condition Property="IsVertical" Value="True"/>
							</MultiTrigger.Conditions>
							<Setter Property="Background" TargetName="grid" Value="{DynamicResource {ComponentResourceKey ResourceId=ButtonBackgroundVer, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="DisplayState" Value="Pressed"/>
								<Condition Property="IsVertical" Value="True"/>
							</MultiTrigger.Conditions>
							<Setter
						Property="Background" TargetName="grid" Value="{DynamicResource {ComponentResourceKey ResourceId=ButtonBackgroundPressedVer, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="DisplayState" Value="Over"/>
								<Condition Property="IsVertical" Value="True"/>
							</MultiTrigger.Conditions>
							<Setter Property="Background" TargetName="grid" Value="{DynamicResource {ComponentResourceKey ResourceId=ButtonBackgroundOverVer, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
							<Setter Property="Visibility" TargetName="shine" Value="Hidden"/>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="DisplayState" Value="Checked"/>
								<Condition Property="IsVertical" Value="True"/>
							</MultiTrigger.Conditions>
							<Setter Property="Background" TargetName="grid" Value="{DynamicResource {ComponentResourceKey ResourceId=ButtonBackgroundSelectedVer, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
							<Setter Property="Visibility" TargetName="shine" Value="Hidden"/>
						</MultiTrigger>
						<Trigger Property="Anchor" Value="Left">
							<Setter Property="LayoutTransform" TargetName="contentPresenter">
								<Setter.Value>
									<TransformGroup>
										<RotateTransform Angle="-90"/>
									</TransformGroup>
								</Setter.Value>
							</Setter>
							<Setter Property="DockPanel.Dock" TargetName="image" Value="Bottom"/>
							<Setter Property="DockPanel.Dock" TargetName="imageSmall" Value="Bottom"/>
							<Setter Property="Margin" TargetName="image" Value="0,2,0,0"/>
							<Setter Property="Margin" TargetName="imageSmall" Value="0,2,0,0"/>
							<Setter Property="HorizontalAlignment" TargetName="dockPanel" Value="Center"/>
						</Trigger>
						<Trigger Property="Anchor" Value="Right">
							<Setter Property="LayoutTransform" TargetName="contentPresenter">
								<Setter.Value>
									<TransformGroup>
										<RotateTransform Angle="90"/>
									</TransformGroup>
								</Setter.Value>
							</Setter>
							<Setter Property="DockPanel.Dock" TargetName="imageSmall" Value="Top"/>
							<Setter Property="DockPanel.Dock" TargetName="image" Value="Top"/>
							<Setter Property="Margin" TargetName="imageSmall" Value="0,0,0,2"/>
							<Setter Property="Margin" TargetName="image" Value="0,0,0,2"/>
							<Setter Property="HorizontalAlignment" TargetName="dockPanel" Value="Center"/>
						</Trigger>
						<Trigger Property="ImageType" Value="Small">
							<Setter Property="Visibility" TargetName="imageSmall" Value="Visible"/>
							<Setter Property="BorderThickness" TargetName="border" Value="{DynamicResource {ComponentResourceKey ResourceId=ButtonSmallBorderThickness, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
						</Trigger>
						<Trigger Property="ImageType" Value="Large">
							<Setter Property="Visibility" TargetName="image" Value="Visible"/>
						</Trigger>
						<Trigger Property="IsContentVisible" Value="False">
							<Setter Property="Visibility" TargetName="headerContent" Value="Collapsed"/>
							<Setter Property="Margin" TargetName="image" Value="0"/>
							<Setter Property="Margin" TargetName="imageSmall" Value="3,0"/>
							<Setter Property="Margin" TargetName="dockPanel" Value="0"/>
							<Setter Property="HorizontalAlignment" TargetName="dockPanel" Value="Center"/>
						</Trigger>
						<Trigger Property="ImageType" Value="Undefined">
							<Setter Property="BorderThickness" TargetName="border" Value="{DynamicResource {ComponentResourceKey ResourceId=ButtonSmallBorderThickness, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Setter Property="Padding" Value="2,0"/>
		<Setter Property="VerticalContentAlignment" Value="Center"/>
		<Setter Property="HorizontalContentAlignment" Value="Left"/>
		<Setter Property="Anchor" Value="Top"/>
		<Setter Property="Foreground" Value="{DynamicResource {ComponentResourceKey ResourceId=ForeColorActive, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
		<Setter Property="SnapsToDevicePixels" Value="True"/>
	</Style>
	<ContextMenu x:Key="DefaultConfigureMenu">
		<local:ConfigureMenuItem MenuType="MoreButtons" />
		<local:ConfigureMenuItem MenuType="FewerButtons" />
		<local:ConfigureMenuItem MenuType="Options" />
		<local:ConfigureMenuItem MenuType="AddRemove" />
		<local:ConfigureMenuItem MenuType="HiddenItems" Separator="Top"/>
	</ContextMenu>
	<ContextMenu x:Key="DefaultItemsButtonsContextMenu">
		<local:ConfigureMenuItem MenuType="NewWindow" />
		<local:ConfigureMenuItem MenuType="Options" />
	</ContextMenu>
	<Style TargetType="{x:Type local:NavigationPane}">
		<Setter Property="ItemsButtonsContextMenu" Value="{StaticResource DefaultItemsButtonsContextMenu}" />
		<Setter Property="ConfigureMenu" Value="{StaticResource DefaultConfigureMenu}" />
		<Setter Property="Focusable" Value="false" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type local:NavigationPane}">
					<DockPanel>
						<Thumb x:Name="PART_ResizeThumb" DockPanel.Dock="Right" Style="{StaticResource ResizeThumb}" />
						<Border x:Name="border" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" d:LayoutOverrides="Height">
							<Grid>
								<Grid.RowDefinitions>
									<RowDefinition/>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto"/>
									<RowDefinition Height="Auto" />
									<RowDefinition Height="Auto"/>
								</Grid.RowDefinitions>
								<local:NavigationPaneExpander x:Name="PART_ContentHost" 
									IsMinimized="{Binding IsMinimized, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}, UpdateSourceTrigger=PropertyChanged}" 
									IsPopupOpen="{TemplateBinding IsPopupOpen}" Background="Transparent" Foreground="{TemplateBinding Foreground}" 
									Margin="{TemplateBinding Padding}" Grid.Row="0" ExpandToolTip="{TemplateBinding ExpandToolTip}" 
									MinimizeToolTip="{TemplateBinding MinimizeToolTip}" BarToolTip="{TemplateBinding BarToolTip}"
									ItemContainerStyle="{StaticResource NavigationItemStyle}" Header="{TemplateBinding ActiveHeader}" HasResizeThumb="False" IsMinimizeButtonVisible="{TemplateBinding IsMinimizeButtonVisible}">
									<local:NavigationPaneExpander.ItemsPanel>
										<ItemsPanelTemplate>
											<DockPanel IsItemsHost="True" LastChildFill="True"/>
										</ItemsPanelTemplate>
									</local:NavigationPaneExpander.ItemsPanel>
									<ContentPresenter ContentSource="SelectedContent"/>
								</local:NavigationPaneExpander>
								<ItemsControl x:Name="selectedItemsSubItems"  Grid.Row="1" Visibility="Collapsed" ItemsSource="{TemplateBinding SelectedItemSubItems}" >
									<ItemsControl.Resources>
										<Style TargetType="{x:Type local:NavigationPaneButton}">
											<Setter Property="Anchor" Value="Left" />
											<Setter Property="Margin" Value="2" />
											<Setter Property="Padding" Value="1,4,0,0" />
											<Setter Property="ImageType" Value="Small" />
										</Style>
									</ItemsControl.Resources>
								</ItemsControl>
								<local:NavigationPaneSplitter Grid.Row="2" Background="{DynamicResource {ComponentResourceKey ResourceId=Background, TypeInTargetAssembly={x:Type local:NavigationPane}}}" BorderBrush="{DynamicResource {ComponentResourceKey ResourceId=ButtonBorder, TypeInTargetAssembly={x:Type local:NavigationPane}}}" BorderThickness="1"
																																						Visibility="{Binding HasSplitter, Converter={StaticResource BooleanToVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}, ConverterParameter=inverse}" IsEnabled="{TemplateBinding IsSplitterEnabled}"/>
								<local:NavigationPanePanel Grid.Row="3" Margin="{TemplateBinding Padding}" />
								<DockPanel Height="25" Grid.Row="4" Margin="{TemplateBinding Padding}" Background="{DynamicResource {ComponentResourceKey ResourceId=ButtonBackground, TypeInTargetAssembly={x:Type local:NavigationPane}}}" 
Visibility="{Binding IsSmallItemsVisible, Converter={StaticResource BooleanToVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}, ConverterParameter=inverse}"									
									>
									<local:NavigationPaneButton x:Name="PART_ConfigureMenuButton" Grid.Column="1" ToolTip="{TemplateBinding ConfigureButtonToolTip}"
										Margin="-1,0,0,0" HorizontalAlignment="Right" Width="15" DockPanel.Dock="Right" HorizontalContentAlignment="Center" >
										<Rectangle x:Name="rectangle" Fill="{DynamicResource {ComponentResourceKey ResourceId=ArrowDown, TypeInTargetAssembly={x:Type local:NavigationPane}}}" Width="6" Height="3" />
									</local:NavigationPaneButton>
									<local:NavigationPanePanel x:Name="SmallItems" Orientation="Horizontal" InverseAlignment="True" DisplayType="Small" MinHeight="16" />
								</DockPanel>
								<Border x:Name="PART_PaneMininizedSizeProvider" HorizontalAlignment="Left" Grid.RowSpan="5" VerticalAlignment="Bottom" Background="Black" Padding="{TemplateBinding Padding}" Visibility="Hidden" >
									<local:NavigationPaneButton ImageType="Large" IsContentVisible="False" Height="Auto" Width="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" CheckMode="Check" IsChecked="True"/>
								</Border>
							</Grid>
						</Border>
					</DockPanel>
					<ControlTemplate.Triggers>
						<Trigger Property="HasResizeThumb" Value="False">
							<Setter Property="Visibility" TargetName="PART_ResizeThumb" Value="Collapsed"/>
						</Trigger>
						<Trigger Property="IsMinimized" Value="True">
							<Setter Property="Visibility" TargetName="SmallItems" Value="Collapsed" />
							<Setter Property="Visibility" TargetName="selectedItemsSubItems" Value="Visible"/>
						</Trigger>
						<Trigger Property="IsMouseOver" Value="True" SourceName="PART_ConfigureMenuButton">
							<Setter Property="Fill" TargetName="rectangle" Value="{DynamicResource {ComponentResourceKey ResourceId=ArrowDownOver, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=Background, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
		<Setter Property="Foreground" Value="{DynamicResource {ComponentResourceKey ResourceId=ForeColorActive, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
		<Setter Property="BorderThickness" Value="{DynamicResource {ComponentResourceKey ResourceId=BorderThickness, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
		<Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey ResourceId=ButtonBorder, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
		<Setter Property="Padding" Value="{DynamicResource {ComponentResourceKey ResourceId=Padding, TypeInTargetAssembly={x:Type local:NavigationPane}}}"/>
		<Setter Property="IsMinimized" Value="False"/>
	</Style>

</ResourceDictionary>